﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.IO;

namespace My_Browser
{
    class Program
    {
        static void Main(string[] args)
        {
            Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            s.Connect("www." + args[0], 80);
            Stream stream = new NetworkStream(s);
            StreamWriter sw = new StreamWriter(stream);
            sw.WriteLine("GET / HTTP/1.1\nHost : " + args[0] +"\nConnection : close\n\n");
            sw.Flush();
            StreamReader sr = new StreamReader(stream);
            Console.Write(sr.ReadToEnd());
            Console.Read();
            s.Close();
        }
    }
}
